package com.easwift.qsp.das.qjy;
import java.io.BufferedOutputStream;

/**
 * 倾角仪写数据线程
 * @author Administrator
 *
 */
public class QJYSocketWriteThread extends Thread{

	private BufferedOutputStream bos;

	public QJYSocketWriteThread(BufferedOutputStream bos) {
		super();
		this.bos = bos;
	}

	@Override
	public void run(){
		try{
			while(true){
				//TODO 地址两位看看应该怎么取到发送
				//读取采集数据格式
				byte[] bytes = {0x00,0x00,(byte)0xd7,(byte)0xef,0x02,0x00,0x00,0x11,0x00,0x00,0x08,0x00,(byte)0xf8,(byte)0xd3};
				bos.write(bytes);
				bos.flush();
				//TODO 读取数据的频率从平台中读取
				Thread.sleep(6000);
			}
		}catch(Exception e){
			e.printStackTrace();
		}
	}

}
